{
  "properties" : { },
  "id" : "copy1663036415413d283",
  "script" : null,
  "groupId" : "9e0a5d32171c4700a791fb1f1eb129c5",
  "name" : "安捷力主数据-asc名称-按区域统计",
  "createTime" : null,
  "updateTime" : 1663050833699,
  "lock" : null,
  "createBy" : null,
  "updateBy" : null,
  "path" : "/asc/ascNameByProvince",
  "method" : "POST",
  "parameters" : [ ],
  "options" : [ {
    "name" : "default_data_source",
    "value" : "cks_dev",
    "description" : "配置默认数据源的key",
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  } ],
  "requestBody" : "{\r\n    \"typeCode\":\"asc\"\r\n}",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"code\": 200,\n    \"message\": \"success\",\n    \"data\": [{\n        \"type\": \"安徽省\",\n        \"dayInsertNum\": 0.0,\n        \"allNum\": 63292.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"北京市\",\n        \"dayInsertNum\": 0.0,\n        \"allNum\": 22617.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"福建省\",\n        \"dayInsertNum\": 2.0,\n        \"allNum\": 60841.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"甘肃省\",\n        \"dayInsertNum\": 0.0,\n        \"allNum\": 49509.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"广东省\",\n        \"dayInsertNum\": 1.0,\n        \"allNum\": 169054.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"广西壮族自治区\",\n        \"dayInsertNum\": 3.0,\n        \"allNum\": 75802.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"贵州省\",\n        \"dayInsertNum\": 2.0,\n        \"allNum\": 62245.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"海南省\",\n        \"dayInsertNum\": 0.0,\n        \"allNum\": 15618.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"河北省\",\n        \"dayInsertNum\": 7.0,\n        \"allNum\": 161452.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"河南省\",\n        \"dayInsertNum\": 1.0,\n        \"allNum\": 143241.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"黑龙江省\",\n        \"dayInsertNum\": 0.0,\n        \"allNum\": 46641.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"湖北省\",\n        \"dayInsertNum\": 0.0,\n        \"allNum\": 73677.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"湖南省\",\n        \"dayInsertNum\": 0.0,\n        \"allNum\": 110218.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"吉林省\",\n        \"dayInsertNum\": 2.0,\n        \"allNum\": 45546.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"江苏省\",\n        \"dayInsertNum\": 0.0,\n        \"allNum\": 87982.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"江西省\",\n        \"dayInsertNum\": 0.0,\n        \"allNum\": 72767.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"辽宁省\",\n        \"dayInsertNum\": 0.0,\n        \"allNum\": 84482.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"内蒙古自治区\",\n        \"dayInsertNum\": 1.0,\n        \"allNum\": 56868.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"宁夏回族自治区\",\n        \"dayInsertNum\": 0.0,\n        \"allNum\": 9781.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"青海省\",\n        \"dayInsertNum\": 0.0,\n        \"allNum\": 8656.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"山东省\",\n        \"dayInsertNum\": 1.0,\n        \"allNum\": 136607.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"山西省\",\n        \"dayInsertNum\": 0.0,\n        \"allNum\": 58196.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"陕西省\",\n        \"dayInsertNum\": 0.0,\n        \"allNum\": 74258.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"上海市\",\n        \"dayInsertNum\": 0.0,\n        \"allNum\": 12472.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"四川省\",\n        \"dayInsertNum\": 0.0,\n        \"allNum\": 164990.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"天津市\",\n        \"dayInsertNum\": 0.0,\n        \"allNum\": 17326.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"西藏自治区\",\n        \"dayInsertNum\": 0.0,\n        \"allNum\": 2791.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"香港特别行政区\",\n        \"dayInsertNum\": 0.0,\n        \"allNum\": 3.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"新疆维吾尔自治区\",\n        \"dayInsertNum\": 1.0,\n        \"allNum\": 30700.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"云南省\",\n        \"dayInsertNum\": 0.0,\n        \"allNum\": 64035.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"浙江省\",\n        \"dayInsertNum\": 0.0,\n        \"allNum\": 76672.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"重庆市\",\n        \"dayInsertNum\": 0.0,\n        \"allNum\": 57892.0,\n        \"cancelAllNum\": 0.0\n    }],\n    \"timestamp\": 1663050830130,\n    \"executeTime\": 27\n}",
  "description" : null,
  "requestBodyDefinition" : {
    "name" : "",
    "value" : "",
    "description" : "",
    "required" : false,
    "dataType" : "Object",
    "type" : null,
    "defaultValue" : null,
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ {
      "name" : "typeCode",
      "value" : "asc",
      "description" : "",
      "required" : false,
      "dataType" : "String",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    } ]
  },
  "responseBodyDefinition" : {
    "name" : "",
    "value" : "",
    "description" : "",
    "required" : false,
    "dataType" : "Object",
    "type" : null,
    "defaultValue" : null,
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ {
      "name" : "code",
      "value" : "200",
      "description" : "",
      "required" : false,
      "dataType" : "Integer",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "message",
      "value" : "success",
      "description" : "",
      "required" : false,
      "dataType" : "String",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "data",
      "value" : "",
      "description" : "",
      "required" : false,
      "dataType" : "Array",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ {
        "name" : "",
        "value" : "",
        "description" : "",
        "required" : false,
        "dataType" : "Object",
        "type" : null,
        "defaultValue" : null,
        "validateType" : "",
        "error" : "",
        "expression" : "",
        "children" : [ {
          "name" : "type",
          "value" : "安徽省",
          "description" : "",
          "required" : false,
          "dataType" : "String",
          "type" : null,
          "defaultValue" : null,
          "validateType" : "",
          "error" : "",
          "expression" : "",
          "children" : [ ]
        }, {
          "name" : "dayInsertNum",
          "value" : "0.0",
          "description" : "",
          "required" : false,
          "dataType" : "Double",
          "type" : null,
          "defaultValue" : null,
          "validateType" : "",
          "error" : "",
          "expression" : "",
          "children" : [ ]
        }, {
          "name" : "allNum",
          "value" : "63292.0",
          "description" : "",
          "required" : false,
          "dataType" : "Double",
          "type" : null,
          "defaultValue" : null,
          "validateType" : "",
          "error" : "",
          "expression" : "",
          "children" : [ ]
        }, {
          "name" : "cancelAllNum",
          "value" : "0.0",
          "description" : "",
          "required" : false,
          "dataType" : "Double",
          "type" : null,
          "defaultValue" : null,
          "validateType" : "",
          "error" : "",
          "expression" : "",
          "children" : [ ]
        } ]
      } ]
    }, {
      "name" : "timestamp",
      "value" : "1663050830130",
      "description" : "",
      "required" : false,
      "dataType" : "Long",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "executeTime",
      "value" : "27",
      "description" : "",
      "required" : false,
      "dataType" : "Integer",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    } ]
  }
}
================================
def sql="""
select province type,sum(val_day) day_Insert_Num,sum(val_all) 'all_Num',sum(cancel_all) 'cancel_All_Num' from st_md_am_pr
where type=#{body.typeCode} ?{body.bigType,and big_type = #{bigType}} and date_str = (SELECT max(date_str) FROM `st_md_am_pr`) 
group by province order by pr_order 
 """
 return db.select(sql)